package org.lzfto.flink.demo.business.flinkTest.flinkObjects.function.reduce;

import org.apache.flink.api.common.functions.ReduceFunction;
import org.lzfto.flink.demo.business.orders.SimpleOrderAgg;

/**
*
*@author lzfto
*@创建时间 2025年6月24日 11:55:49
*/
public class OrderAggReduceFun implements ReduceFunction<SimpleOrderAgg> {
	private static final long serialVersionUID = 1L;

	@Override
	public SimpleOrderAgg reduce(SimpleOrderAgg value1, SimpleOrderAgg value2) throws Exception {
		return new SimpleOrderAgg(value1.getZoneName(), value1.getSex(),
				value1.getTotal().add(value2.getTotal()), value1.getCount() + value2.getCount());
	}

}
